-
Notifications
You must be signed in to change notification settings - Fork 913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xpay: emulate maxfeepercent and exemptfee when xpay-handle-pay used #7942
xpay: emulate maxfeepercent and exemptfee when xpay-handle-pay used #7942
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should work.
plugins/xpay/xpay.c
Outdated
} else | ||
maxfeepercent_ppm = 500000 / 100; | ||
|
||
if (!amount_msat_fee(&maxfee, amount, 0, maxfeepercent_ppm)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maxfeepercent
is a percent in the way this argument is treated by pay
and the users of this api expect that.
if (!amount_msat_fee(&maxfee, amount, 0, maxfeepercent_ppm)) | |
if (!amount_msat_fee(&maxfee, amount, 0, maxfeepercent_ppm/100)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
plugins/xpay/xpay.c
Outdated
&maxfeepercent_ppm)) | ||
return false; | ||
} else | ||
maxfeepercent_ppm = 500000 / 100; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also here. If this is a percent then 500'000 ppm means 0.5%
maxfeepercent_ppm = 500000 / 100; | |
maxfeepercent_ppm = 500000; |
maxfeepercent is use by Zeus, so let's make that work. maxfee is more precise, so it's the only xpay option (maxfee was added to pay later). [ Fix to ppm logic by Lagrang3, thanks! --RR ] Fixes: ElementsProject#7926 Changelog-Changed: JSON-RPC: With `xpay-handle-pay` set, xpay will now be used even if `pay` uses maxfeeprecent or exemptfee parameters (e.g. Zeus) Signed-off-by: Rusty Russell <[email protected]>
1369f2c
to
49aff81
Compare
maxfeepercent is use by Zeus, so let's make that work.
maxfee is more precise, so it's the only xpay option (maxfee was added to pay later).
Fixes: #7926
I prefer this to #7936